package jsyf.oa.dao.device;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import jsyf.oa.entity.device.DevicelogisticsEntity;
import jsyf.oa.idao.BaseDao;
import jsyf.oa.ientity.IBaseEntity;
import org.springframework.stereotype.Repository;

/**
 * Created by y on 2018/6/28.
 */
@Repository
public class DevicelogisticsDao extends BaseDao{
    public DevicelogisticsDao() {
        super.iBaseEntity = new DevicelogisticsEntity();
    }
    @Override
    public IBaseEntity convertJson2Entity(JSONObject json) {
        return JSON.toJavaObject(json, DevicelogisticsEntity.class);
    }
    public String getId(String sampleId){
        StringBuffer sql=new StringBuffer();
        sql.append(" select id from T_DVC_LOGISTICS_CHANGE where SAMPLE_ID=?");
        return super.queryForString(sql.toString(),new Object[]{sampleId});
    }
}
